Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ENH: register callback for saveRoi viewer event #701

Closed
wants to merge 1 commit into from

Conversation

PaulHax
Copy link
Collaborator

@PaulHax PaulHax commented Dec 2, 2023

Depends on Kitware/itk-vtk-viewer#723

This is the viewer_config.py file I'm using to test:

ITK_VIEWER_SRC = (
    "http://localhost:8082"
)
PYDATA_SPHINX_HREF = "http://localhost:3000/dist/bootstrapUIMachineOptions.js.es.js"
MUI_HREF = "https://cdn.jsdelivr.net/npm/[email protected]/dist/materialUIMachineOptions.js.es.js"

@PaulHax PaulHax requested a review from bnmajor December 2, 2023 19:00
@@ -124,6 +127,9 @@ def update_screenshot(self, base64_image):
</script>
''')
self.img.display(html)

def save_roi(self, roi):
print('save roi', roi)
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not seeing this actualy print, so missing something...

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Print statements do not bubble up correctly from the ViewerRPC class. You can use api.log(f'save roi {roi}') instead and the message will be output in the console log

Copy link
Collaborator Author

@PaulHax PaulHax Dec 2, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, thank you. This is the output:
Plugin 5b4de75c-9cb8-490b-8c32-28c9ae68f0c4: save roi {'name': 'Image', 'layerName': 'Image', 'croppingPlanes': [{'origin': [-0.5, -0.5, -0.5], 'normal': [1, 0, 0]}, {'origin': [127.5, 127.5, 255.5], 'normal': [-1, 0, 0]}, {'origin': [-0.5, -0.5, -0.5], 'normal': [0, 1, 0]}, {'origin': [127.5, 127.5, 255.5], 'normal': [0, -1, 0]}, {'origin': [-0.5, -0.5, -0.5], 'normal': [0, 0, 1]}, {'origin': [127.5, 127.5, 255.5], 'normal': [0, 0, -1]}]}

@thewtex
Copy link
Member

thewtex commented Dec 4, 2023

This is not supporting the itkwidgets workflow as discussed in Kitware/itk-vtk-viewer#723

@thewtex thewtex closed this Dec 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants